<!-- xml version="1.0" encoding="utf-8" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
	<title>Simple Latin Sentences</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<link href="classics.css" rel="stylesheet" type="text/css">
</head>
<?php


try {
	$db = new PDO('sqlite:voc/voc.sqlite3');
	$q = $db->query('SELECT DISTINCT Grp FROM Swain ORDER BY Grp;');
	$groups = array();
	foreach( $q->fetchAll() as $row) {
		$groups[$row['Grp']] = array();
	}

	$db = NULL;
} catch (PDOException $e) {
    print "Error!: " . $e->getMessage() . "<br/>";
    die();
}

?>


<body>

<h1 align="center">Simple Latin Sentences</h1>
<div id="container">
<div id="center">
<form name="v01" action="voc/swain.php" method="post">
<table align="center">
<tr><td colspan=10>Group: </td></tr>
<?php

$n = 0;
print "<tr>";
foreach($groups as $grp => $alib) {
	print "<td><input type=\"radio\" name=\"grp\" value=\"$grp\" />$grp.</td>";
	$n++;
	if (! ($n % 10)) {
		print "</tr>\n<tr>";
	}
}
print "</tr>\n";

?>
<tr class="separate-above">
	<td align="center" colspan=10><input type="submit" value="Submit" /></td>
</tr>
</table>
</form>
</div>
</div>

</body>
</html>
